﻿using System;
using System.Collections.Generic;
using net.entity.framework.common;

namespace net.entity.framework.query {
    public sealed class DbCatalogue {
        private readonly Dictionary<Type, KeyValuePair<string, string>> catalogue =
            new Dictionary<Type, KeyValuePair<string, string>>();

        public void Add(Type objType, string catalogueName, string tableName) {
            catalogue[objType] = catalogue.LookupOrDefault(objType,
                                                           new KeyValuePair<string, string>(catalogueName, tableName));
        }

        public KeyValuePair<string, string> GetCatalog(Type objType, bool strict) {
            return catalogue.Lookup(objType, strict);
        }
    }
}